/**
 * Copyright (C), 2015-2024, XXX有限公司
 * FileName: NetWorkManager
 * Author: chenchen
 * Date: 2024/6/14 10:15
 * Description:
 * History:
 * <author> <time> <version> <desc>
 * 作者姓名 修改时间 版本号 描述
 */
package com.example.retrofit.api;

import com.eyuai.netlibrary.RxHttpUtils;

import java.util.concurrent.TimeUnit;

import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * 16 * @ClassName: NetWorkManager
 *
 * @Description: java类作用描述
 * @Author: chenchen
 * @Date: 2024/6/14 10:15
 */
public class NetWorkManager {

    private OneApiService mOneApiService;
    private TwoApiService mTwoApiService;
    private ThreeApiService mThreeApiService;

    private static class NetWorkManagerHolder {
        private static final NetWorkManager INSTANCE = new NetWorkManager();
    }

    public static final NetWorkManager getInstance() {
        return NetWorkManagerHolder.INSTANCE;
    }

    private NetWorkManager() {
        this.mOneApiService = RxHttpUtils.createApi(Api.GITHUB_DOMAIN_NAME, Api.APP_GITHUB_DOMAIN, OneApiService.class);
        this.mTwoApiService = RxHttpUtils.createApi(Api.GANK_DOMAIN_NAME, Api.APP_GANK_DOMAIN, TwoApiService.class);
        this.mThreeApiService = RxHttpUtils.createApi(Api.DOUBAN_DOMAIN_NAME, Api.APP_DOUBAN_DOMAIN, ThreeApiService.class);
    }


    public OneApiService getOneApiService() {
        return mOneApiService;
    }

    public TwoApiService getTwoApiService() {
        return mTwoApiService;
    }

    public ThreeApiService getThreeApiService() {
        return mThreeApiService;
    }

}
